package com.markerhub.service.impl;

import com.markerhub.entity.SysCourseApply;
import com.markerhub.mapper.SysCourseApplyMapper;
import com.markerhub.service.SysCourseApplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wang
 * @since 2022-04-07
 */
@Service
public class SysCourseApplyServiceImpl extends ServiceImpl<SysCourseApplyMapper, SysCourseApply> implements SysCourseApplyService {

    @Override
    public List<Long> getList(SysCourseApply sysCourseApply) {


        List<Long> t=new ArrayList<>();
        Integer m=0;
        do{
            if(m==sysCourseApply.getTime().length()-1){
                t.add(Long.valueOf(sysCourseApply.getTime().charAt(m)));
            }else{
                if(sysCourseApply.getTime().charAt(m)!=',' & sysCourseApply.getTime().charAt(m+1)==','){
                    t.add(Long.valueOf(sysCourseApply.getTime().charAt(m)));
                    m=m+2;
                }else if(sysCourseApply.getTime().charAt(m)!=',' & sysCourseApply.getTime().charAt(m+1)!=',' ) {//一个两位数
                    t.add(Long.valueOf(sysCourseApply.getTime().charAt(m) * 10 + sysCourseApply.getTime().charAt(m + 1)));
                    m=m+3;
                }
            }
        }while(m<sysCourseApply.getTime().length());
        return t;
    }
}
